package com.sky.mapper;

import com.sky.entity.PackageProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PackageProviderMapper {

    /**
     * 根据套餐id查询包含的服务人员id
     * @param packageId
     * @return
     */
    @Select("select provider_id from package_provider where package_id = #{packageId}")
    List<Long> getProviderIdsByPackageId(Long packageId);

    /**
     * 根据服务人员id查询包含的套餐id
     * @param providerIds
     * @return
     */
    List<Long> getPackageIdByProviderIds(List<Long> providerIds);

    /**
     * 批量插入套餐人员关联数据
     * @param packageProviders
     */
    void insertBatch(List<PackageProvider> packageProviders);

    /**
     * 根据套餐id删除套餐人员关联数据
     * @param packageId
     */
    void deleteByPackageId(Long packageId);
} 